
 
 F u n c t i o n :   m o r p h ( s t r i n g M a r k u p O r C S S S e l e c t o r ,   b o o l R e t u r n A r r a y ,   d o m C o n t e x t ) 
 
 
 
 D e s c r i p t i o n :   W i l l   t r a n s f o r m   a n y   m a r k u p   s t r i n g ,   C S S   s e l e c t o r ,   o r   n u m b e r   o b j e c t   i n t o   a   r e t u r n a b l e   D O M   n o d e   o b j e c t   t h a t   s u p p o r t s   e l e m e n t . a p p e n d C h i l d ( ) ,   o r   a s   a n   i t e r a b l e   a r r a y . 
 
 
 
 R e t u r n s :   d o m E l e m e n t ,   o r   a n   A r r a y   o f   d o m E l e m e n t s . 
 
 
 
 N o t e :   I f   a   d o m   N o d e   i s   p a s s e d   i n t o   t h e   f i r s t   p a r a m e t e r   i n s t e a d   o f   a   s t r i n g   o r   n u m b e r   o b j e c t ,   i t   w i l l   b e   r e t u r n e d   w i t h o u t   m o d i f i c a t i o n .   W h e n   b o o l R e t u r n A r r a y   i s   t r u e ,   a n   a r r a y   o f   D O M   n o d e s   w i l l   b e   r e t u r n e d   i n s t e a d .   W h e n   d o m C o n t e x t   i s   s e t   t o   a   D O M   n o d e   c o n t a i n e r   e l e m e n t ,   t h e   c o n t e x t   e l e m e n t   w i l l   b e   q u e r i e d   i f   t h e   f i r s t   p a r a m e t e r   i s   a   v a l i d   C S S   s e l e c t o r .   O t h e r w i s e ,   d o m C o n t e x t   w i l l   a l w a y s   b e   s e t   t o   d o c u m e n t   w h e n   n o t   s p e c i f i e d . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   T r a n s f o r m   a   m a r k u p   s t r i n g   i n t o   a   D O M   n o d e . 
 
 v a r   m y N o d e   =   $ A . m o r p h ( ' < d i v   c l a s s = " m y - c o n t e n t - c l a s s " > S t u f f   h e r e . < / d i v > ' ) ; 
 
 
 
 / /   T r a n s f o r m   a   C S S   s e l e c t o r   i n t o   a   D O M   n o d e . 
 
 v a r   m y N o d e   =   $ A . m o r p h ( " # m y E l e m e n t I d " ) ; 
 
 
 
 / /   T r a n s f o r m   a   C S S   s e l e c t o r   i n t o   a   D O M   n o d e   o r   a n   a r r a y   o f   D O M   n o d e s . 
 
 / /   W i l l   r e t u r n   a n   H 2   D O M   n o d e   i f   o n l y   o n e   i s   f o u n d ,   o t h e r w i s e   a l l   m a t c h e s   w i l l   b e   r e t u r n e d   a s   a n   a r r a y . 
 
 v a r   m y O b j e c t   =   $ A . m o r p h ( " h 2 " ) ; 
 
 
 
 / /   T r a n s f o r m   a   C S S   s e l e c t o r   i n t o   a   D O M   n o d e   a n d   r e t u r n   a l l   m a t c h i n g   e l e m e n t s   i n   a n   a r r a y . 
 
 / /   W i l l   a l w a y s   r e t u r n   a n   a r r a y ,   e v e n   w h e n   n o   m a t c h e s   a r e   f o u n d ,   o r   w h e n   o n e   m a t c h   i s   f o u n d . 
 
 v a r   m y N o d e s   =   $ A . m o r p h ( " h 1 " ,   t r u e ) ; 
 
 
 
 / /   T r a n s f o r m   a   n u m b e r   o b j e c t   i n t o   a   D O M   t e x t   n o d e . 
 
 v a r   m y N o d e   =   $ A . m o r p h ( 4   +   3   +   5 ) ; 
 
 
 
 / /   T r a n s f o r m   a   t e x t   s t r i n g   i n t o   a   D O M   t e x t   n o d e . 
 
 v a r   m y N o d e   =   $ A . m o r p h ( " H e r e   w e   a r e   n o w ,   e n t e r t a i n   u s . " ) ; 
 
 
 
 / /   V i e w   t h e   $ A . t o N o d e ( )   h e l p   d o c u m e n t a t i o n   t o   l e a r n   h o w   t o   c o n v e r t   a n   a r r a y   o f   D O M   n o d e s   b a c k   i n t o   a   s i n g l e   d o c u m e n t   f r a g m e n t   e l e m e n t ,   a v a i l a b l e   a t :   " H e l p / $ A   A P I / D O M   E l e m e n t s / T o N o d e " 
 
 